import { use } from 'echarts/core'
import VueEcharts from 'vue-echarts'

// 手动引入 ECharts 各模块来减小打包体积
import { CanvasRenderer, SVGRenderer } from 'echarts/renderers'
import { BarChart, PieChart, LineChart, RadarChart, EffectScatterChart, MapChart } from 'echarts/charts'
import {
  GridComponent,
  TooltipComponent,
  PolarComponent,
  TitleComponent,
  LegendComponent,
  ToolboxComponent,
  VisualMapComponent,
  GeoComponent,
  MarkPointComponent
} from 'echarts/components'

use([
  SVGRenderer,
  CanvasRenderer,
  BarChart,
  PieChart,
  LineChart,
  RadarChart,
  MapChart,
  EffectScatterChart,
  GridComponent,
  TooltipComponent,
  PolarComponent,
  TitleComponent,
  LegendComponent,
  ToolboxComponent,
  VisualMapComponent,
  GeoComponent,
  MarkPointComponent
])

export default (app) => {
  app.component('v-chart', VueEcharts)
}
